package com.yjt.gcss.gddw.common.bean.domain;

import java.util.HashMap;
import java.util.Map;

import com.yjt.common.tools.TimeUtil;

/**
 * InfoSsxy entity. @author MyEclipse Persistence Tools
 */
public class InfoSsxy extends AbstractInfoSsxy implements java.io.Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static final String BEAN_PACKAGE_NAME = "com.yjt.gcss.gddw.common.bean.domain.InfoSsxy";
    private String protNoType;
    private String tranTypeDesc;
	// Constructors

	/** default constructor */
	public InfoSsxy() {
	}

	/** minimal constructor */
	public InfoSsxy(String reqMsgId, String resendCount, String protActType,
			String orgId, String protNo, String userNo, String userName,
			String entrustDate, String contactNo, String tranType,
			String payerBank, String payerAcc, String payerName,
			String payerMobile, String status, String source) {
		super(reqMsgId, resendCount, protActType, orgId, protNo, userNo,
				userName, entrustDate, contactNo, tranType, payerBank,
				payerAcc, payerName, payerMobile, status, source);
	}

	/** full constructor */
	public InfoSsxy(String reqMsgId, String resendCount, String resendReqMsgId,
			String protActType, String orgId, String protNo, String userNo,
			String userName, String entrustDate, String contactName,
			String contactAddr, String contactAddrPost, String contactNo,
			String tranType, String payerBank, String payerAcc,
			String payerName, String payerCreditType, String payerCreditNo,
			String payerMobile, String payerEmail, String remark,
			String status, String retCd, String retCdRemark,
			String workReturnNo, String synFlag, String reserve,
			String createDate, String createTime, String rspDate,
			String rspTime, String source, String oprName) {
		super(reqMsgId, resendCount, resendReqMsgId, protActType, orgId,
				protNo, userNo, userName, entrustDate, contactName,
				contactAddr, contactAddrPost, contactNo, tranType, payerBank,
				payerAcc, payerName, payerCreditType, payerCreditNo,
				payerMobile, payerEmail, remark, status, retCd, retCdRemark,
				workReturnNo, synFlag, reserve, createDate, createTime,
				rspDate, rspTime, source, oprName);
	}

	
	// 协议类型
	public String getProtNoType() {
		String ProtNo = this.getProtNo();
		Map<String,String> protNoType=new HashMap<String, String>();
		protNoType.put("01", "代收协议");
		protNoType.put("02", "代付协议");  
		if (ProtNo != null && !("").equals(ProtNo)) {
			String pt = this.getProtNo().substring(0, 2);
			return protNoType.get(pt);  
		}
		return "";
	}  
	
	
	//协议操作标识
	public String getProtActTypeDesc(){
		Map<String,String> protActTypeCHMap=new HashMap<String, String>();
		protActTypeCHMap.put("ADD", "新增");
		protActTypeCHMap.put("DEL", "撤销"); 
		return protActTypeCHMap.get(getProtActType());      
	}
	
	//协议状态
	public String getStatusDesc(){
		String status=this.getStatus();
		Map<String,String> statusCHMap=new HashMap<String, String>();
		statusCHMap.put("W", "待处理");
		statusCHMap.put("A", "待回应");  
		statusCHMap.put("S", "成功"); 
		statusCHMap.put("F", "失败"); 		
		return statusCHMap.get(status);    
	}
	

    //同步标识
  	public String getSynFlagDesc(){
  		String synFlag=this.getSynFlag();
  		Map<String,String> synFlagCHMap=new HashMap<String, String>();
  		synFlagCHMap.put("S", "已同步");
  		synFlagCHMap.put("N", "未同步"); 	
  		return synFlagCHMap.get(synFlag);      
  	}
  	
 	
  	 //付款人证件类型 	
  	public String getPayerCreditTypeDesc(){
  		Map<String,String> payerCreditTypeCHMap=new HashMap<String, String>();
  		payerCreditTypeCHMap.put("0", "身份证");
  		payerCreditTypeCHMap.put("1", "户口簿");
  		payerCreditTypeCHMap.put("2", "护照");
  		payerCreditTypeCHMap.put("3", "军官证");
  		payerCreditTypeCHMap.put("4", "士兵证");
  		payerCreditTypeCHMap.put("5", "港澳居民来往内地通行证");
  		payerCreditTypeCHMap.put("6", "台湾同胞来往内地通行证");
  		payerCreditTypeCHMap.put("7", "临时身份证");
  		payerCreditTypeCHMap.put("8", "外国人居留证");
  		payerCreditTypeCHMap.put("9", "警官证");
  		payerCreditTypeCHMap.put("X", "其他证件");
  		return payerCreditTypeCHMap.get(this.getPayerCreditType());
  	}

	public void setProtNoType(String protNoType) {
		this.protNoType = protNoType;
	}
  	
	//日期格式转换
	public String getEntrustDateDescr() {
		if(TimeUtil.checkDate(this.getEntrustDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getEntrustDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	
	public String getCreateDateDescr() {
		if(TimeUtil.checkDate(this.getCreateDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getCreateDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	
	public String getCreateTimeDescr() {
		if(TimeUtil.checkDate(this.getCreateTime(), "HHmmss")) {
			return TimeUtil.changeStrTimeFormat(this.getCreateTime(), "HHmmss", "HH:mm:ss");
		}
		return "";
	}

	public String getRspDateDescr() {
		if(TimeUtil.checkDate(this.getRspDate(), "yyyyMMdd")) {
			return TimeUtil.changeStrTimeFormat(this.getRspDate(), "yyyyMMdd", "yyyy-MM-dd");
		}
		return "";
	}
	public String getRspTimeDescr() {
		if(TimeUtil.checkDate(this.getRspTime(), "HHmmss")) {
			return TimeUtil.changeStrTimeFormat(this.getRspTime(), "HHmmss", "HH:mm:ss");
		}
		return "";
	}

	public void setTranTypeDesc(String tranTypeDesc) {
		this.tranTypeDesc = tranTypeDesc;
	}
	
	public String getOprTimeDescr() {
		if(TimeUtil.checkDate(this.getCreateDate()+this.getCreateTime(), "yyyyMMddHHmmss")) {
			return TimeUtil.changeStrTimeFormat(this.getCreateDate()+this.getCreateTime(), "yyyyMMddHHmmss", "yyyy-MM-dd HH:mm:ss");
		}
		return "";
	}
	
}

